#include "stm32f10x.h"     
#include "delay.h"
#include "key.h"
#include "led.h"
#include "pwm.h"
uint16_t i;
int main()
{
LED_Init();
PWM_Init(1000-1, 72-1);//1kHz
PWM_SetCompare2(800);//占空比大，高电平时间多,灯比较暗



	
while(1){	
for(i=0; i<=1000; i++)
{
PWM_SetCompare2(i);
Delay_ms(1);//延时一下便于观察呼吸效果
}

for(i=1000; i>0; i--)
{
PWM_SetCompare2(i);
Delay_ms(1);
}
}
}





















